<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of harris</title>
  <meta name="keywords" content="harris">
  <meta name="description" content="HARRIS obtains the Harris transform of image.">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2005 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../../m2html.css">
  <script type="text/javascript">
    if (top.frames.length == 0) { top.location = "../../index.html"; };
  </script>
</head>
<body>
<a name="_top"></a>
<!-- # RADOCCToolbox --><!-- menu.html CornerFinder -->
<h1>harris
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>HARRIS obtains the Harris transform of image.</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>function imgout=harris(img,win) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre class="comment"> HARRIS obtains the Harris transform of image.
 
 HARRIS takes gets the Harris transform image of an input grayscale image.
 
 USAGE:
     imgout=harris(img); if win is not specified the default value is
     used min(size(img))/140
 
     imgout=harris(img,win); win is the window size of the Harris
     transform
 
 INPUTS:
     img: grayscale double class image
 
     win: scalar specifying the window size
 
 OUTPUTS:
 imgout: Harris transform image</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../../matlabicon.gif)">
<li><a href="gscale.html" class="code" title="function g=gscale(f,method,low,high)">gscale</a>	GSCALE adjusts the scale of an image.</li></ul>
This function is called by:
<ul style="list-style-image:url(../../matlabicon.gif)">
<li><a href="findcorners.html" class="code" title="function imgcout=findcorners(img,debug)">findcorners</a>	FINDCORNERS is the main function called by the calibration GUI.</li></ul>
<!-- crossreference -->



<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function imgout=harris(img,win)</a>
0002 <span class="comment">% HARRIS obtains the Harris transform of image.</span>
0003 <span class="comment">%</span>
0004 <span class="comment">% HARRIS takes gets the Harris transform image of an input grayscale image.</span>
0005 <span class="comment">%</span>
0006 <span class="comment">% USAGE:</span>
0007 <span class="comment">%     imgout=harris(img); if win is not specified the default value is</span>
0008 <span class="comment">%     used min(size(img))/140</span>
0009 <span class="comment">%</span>
0010 <span class="comment">%     imgout=harris(img,win); win is the window size of the Harris</span>
0011 <span class="comment">%     transform</span>
0012 <span class="comment">%</span>
0013 <span class="comment">% INPUTS:</span>
0014 <span class="comment">%     img: grayscale double class image</span>
0015 <span class="comment">%</span>
0016 <span class="comment">%     win: scalar specifying the window size</span>
0017 <span class="comment">%</span>
0018 <span class="comment">% OUTPUTS:</span>
0019 <span class="comment">% imgout: Harris transform image</span>
0020 
0021 <span class="keyword">if</span> ~exist(<span class="string">'win'</span>,<span class="string">'var'</span>)|| isempty(win)
0022     win=round(min(size(img))/140);
0023 <span class="keyword">end</span>
0024 
0025 dx =[-1 0 1; -2 0 2;-1 0 1]; <span class="comment">% The Mask</span>
0026     dy = dx';
0027 
0028     
0029     ix = conv2(img, dx, <span class="string">'same'</span>);   
0030     iy = conv2(img, dy, <span class="string">'same'</span>);
0031     m = fspecial(<span class="string">'average'</span>,win);
0032     
0033 
0034     a = conv2(ix.^2, m, <span class="string">'same'</span>);  
0035     b = conv2(iy.^2, m, <span class="string">'same'</span>);
0036     c = conv2(ix.*iy,m,<span class="string">'same'</span>);
0037 
0038     imgout = (a.*b - c.^2)./(a + b + eps);
0039     imgout=<a href="gscale.html" class="code" title="function g=gscale(f,method,low,high)">gscale</a>(imgout,<span class="string">'minmax'</span>);</pre></div>
<hr><address>Generated on Sun 04-Apr-2010 17:13:59 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" target="_parent">m2html</a></strong> &copy; 2005</address>
</body>
</html>